package com.gap.historyemployee;

import com.buanalintas.framework.Dictionary;
import com.gap.entities.GapTransactionHistoryEmployee;
import com.buanalintas.framework.Field;
import com.buanalintas.framework.Page;

/**
 *
 * Class HistoryEmployee is ...
 *
 * Generated on Fri Jan 09 13:17:48 ICT 2015
 *
 * @version 1.0
 * @author  Mr. Kazao™
 * @since   Bynga 1.0
 *
 */
public class HistoryEmployee extends Page {

    
    private Field historyId;
    
    private Field historyEmployeeName;
    
    private Field historyStatus;
    
//    private Field historyDate;
    
    private Field historyPlatform;
    
    private Field historyValue;
    
    private Field historyCurrent;
    
    private Field historyLast;
    
    private Field historyDescription;
    
    private Field historyTimestamp;
    
    private Field historyUserId;
    
    private Field historyUnitId;
    
    private Field historyEmployeeId;
    

    public HistoryEmployee() {
        super();

        setTheClass(GapTransactionHistoryEmployee.class);
        
        
        
        
        historyId = new Field();
        historyId.setName("historyId");
        historyId.setCaption("id");
        //historyId.setInfo("history id");
        historyId.setListProperties(" align=\"left\" width=\"1%\" nowrap");
        historyId.setInputProperties(" size=\"20\"");        
        getFields().add(historyId);
        
        historyEmployeeName = new Field();
        historyEmployeeName.setName("historyEmployeeName");
        historyEmployeeName.setCaption("employee name");
        //historyEmployeeName.setInfo("history employee name");
        historyEmployeeName.setListProperties(" align=\"left\" width=\"15%\" nowrap");
        historyEmployeeName.setInputProperties(" size=\"20\"");        
        getFields().add(historyEmployeeName);
        
        historyStatus = new Field();
        historyStatus.setName("historyStatus");
        historyStatus.setCaption("status");
        //historyStatus.setInfo("history platform");
        historyStatus.setListProperties(" align=\"right\" width=\"10%\" nowrap");
        historyStatus.setInputProperties(" size=\"20\"");  
        historyStatus.setInputType(Field.INPUT_CHECK_BOX);
        historyStatus.getOptions().add(new String[]{"1", "Cancel"});
        getFields().add(historyStatus);
        
//        historyDate = new Field();
//        historyDate.setName("historyDate");
//        historyDate.setCaption(" date");
//        //historyDate.setInfo("history date");
//        historyDate.setListProperties(" align=\"center\" width=\"1%\" nowrap");
//        historyDate.setInputProperties(" size=\"8\"");
//        //historyDate.setFormatter(DateFormatter.getInstanceDate(this));
//        getFields().add(historyDate);
        
        historyPlatform = new Field();
        historyPlatform.setName("historyPlatform");
        historyPlatform.setCaption("platform");
        //historyPlatform.setInfo("history platform");
        historyPlatform.setListProperties(" align=\"right\" width=\"10%\" nowrap");
        historyPlatform.setInputProperties(" size=\"20\"");        
        getFields().add(historyPlatform);
        
        historyValue = new Field();
        historyValue.setName("historyValue");
        historyValue.setCaption(" value");
        //historyValue.setInfo("history value");
        historyValue.setListProperties(" align=\"right\" width=\"10%\" nowrap");
        historyValue.setInputProperties(" size=\"20\"");        
        getFields().add(historyValue);
        
        historyLast = new Field();
        historyLast.setName("historyLast");
        historyLast.setCaption("last");
        //historyLast.setInfo("history last");
        historyLast.setListProperties(" align=\"right\" width=\"10%\" nowrap");
        historyLast.setInputProperties(" size=\"20\"");        
        getFields().add(historyLast);
        
        historyCurrent = new Field();
        historyCurrent.setName("historyCurrent");
        historyCurrent.setCaption(" saldo");
        //historyCurrent.setInfo("history current");
        historyCurrent.setListProperties(" align=\"right\" width=\"10%\" nowrap");
        historyCurrent.setInputProperties(" size=\"20\"");        
        getFields().add(historyCurrent);
        
        historyDescription = new Field();
        historyDescription.setName("historyDescription");
        historyDescription.setCaption(" description");
        //revisionDescription.setInfo("revision description");
        historyDescription.setListProperties(" align=\"left\" width=\"1%\" nowrap");
        historyDescription.setInputProperties(" size=\"20\"");        
        getFields().add(historyDescription);
        
        historyTimestamp = new Field();
        historyTimestamp.setName("historyTimestamp");
        historyTimestamp.setCaption("timestamp");
        //historyTimestamp.setInfo("history timestamp");
        historyTimestamp.setListProperties(" align=\"center\" width=\"10%\" nowrap");
        historyTimestamp.setInputProperties(" size=\"12\"");
        //historyTimestamp.setFormatter(DateFormatter.getInstanceDateTime(this));
        getFields().add(historyTimestamp);
        
        historyUserId = new Field();
        historyUserId.setName("historyUserId");
        historyUserId.setCaption("user");
        //historyUserId.setInfo("history user id");
        historyUserId.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        historyUserId.setInputProperties(" size=\"20\"");        
        getFields().add(historyUserId);
        
        historyUnitId = new Field();
        historyUnitId.setName("historyUnitId");
        historyUnitId.setCaption("unit");
        //historyUnitId.setInfo("history unit id");
        historyUnitId.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        historyUnitId.setInputProperties(" size=\"20\"");        
        getFields().add(historyUnitId);
        
        historyEmployeeId = new Field();
        historyEmployeeId.setName("historyEmployeeId");
        historyEmployeeId.setCaption("employee");
        //historyEmployeeId.setInfo("history employee id");
        historyEmployeeId.setListProperties(" align=\"left\" width=\"15%\" nowrap");
        historyEmployeeId.setInputProperties(" size=\"20\"");        
        getFields().add(historyEmployeeId);
        

        fillFields();
        getFieldsList().clear();
        getFieldsList().add(historyEmployeeId);
        getFieldsList().add(historyPlatform);
        getFieldsList().add(historyUserId);
        getFieldsList().add(historyUnitId);
        getFieldsList().add(historyStatus);
        getFieldsList().add(historyLast);
        getFieldsList().add(historyValue);
        getFieldsList().add(historyCurrent);
        getFieldsList().add(historyTimestamp);
        getFieldsList().add(historyDescription);

        getFieldsView().clear();
        getFieldsView().add(historyEmployeeId);
        getFieldsView().add(historyPlatform);
        getFieldsView().add(historyUserId);
        getFieldsView().add(historyUnitId);
        getFieldsView().add(historyStatus);
        getFieldsView().add(historyLast);
        getFieldsView().add(historyValue);
        getFieldsView().add(historyCurrent);
        getFieldsView().add(historyTimestamp);
        getFieldsView().add(historyDescription);

        setExportList(getClass().getResourceAsStream("HisEmployeeList.jasper"));
        setExport(getClass().getResourceAsStream("HisEmployee.jasper"));
    }
    
       @Override
    public void beforeExport() {
        getExportParams().put("title", Dictionary.getValue(this, "History Employee"));
    }

    @Override
    public void beforeExportMulti() {
        beforeExport();
    }
}
